package com.hopes.bizz.basic.gis.vo.hazard;

import com.hopes.bizz.basic.common.constant.enums.ParkBasicSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import lombok.Data;

import java.io.Serializable;
import java.util.Optional;

/**
 * @author yumr
 * @ProjectName bizz
 * @Description 危险源等级Vo对象
 * @time 2024/1/18 18:59
 */
@Data
public class HazLevelVO implements Serializable {

    private static final long serialVersionUID = -7139330387638130252L;

    /**
     * 等级
     */
    private String level;

    /**
     * 数量
     */
    private Integer count;

    public HazLevelVO(String level, Integer count) {
        this.level = level;
        this.count = Optional.ofNullable(count).orElse(0);
    }

    public String getLevelStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.haz_hazard_source_level, this.getLevel());
    }

}
